<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>position_sticky应用</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            .container {
                width: 100%;
                height: auto;
            }
            .container .item {
                width: 100%;
                height: auto;
            }
            .container .item .letter {
                width: 100%;
                height: 50px;
                line-height: 50px;
                padding: 0 20px;
                box-sizing: border-box;
                background: rgb(0, 191, 255);
                color: #fff;
                font-size: 30px;
                position: sticky;
                top: 0px;
            }
            .container .item .content {
                width: 100%;
                height: 300px;
            }
        </style>
    </head>

    <body>
        <div class="container">
            <div class="item">
                <p class="letter">A</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">B</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">C</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">D</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">E</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">F</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">G</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">H</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">I</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
            <div class="item">
                <p class="letter">J</p>
                <p class="content">XXXXXXXXXXXXXXXXXXXXXXXX</p>
            </div>
        </div>
    </body>

</html>